//-------------------------------------------------------
// Copyright (c) 
// All rights reserved.
// 
// File Name: TabTipSystemBase.h 
// File Des: 系统输入状态检测通用模式，win10、win11、server2019
// File Summary: 
// Cur Version: 1.0
// Author:
// Create Data:
// History:
//         <Author>    <Time>        <Version>      <Des>
//      lzlong        2023-7-20    1.0            
//-------------------------------------------------------
#pragma once
#include "misc\DeclareDefine.h"
#include "wndipc\IIPCWndCallBack.h"

#define TABTIP_DECLAREREG_CLASS(OBJ, Type)                                     \
  DECLARE_REG_CLASS(OBJ, Enum2WStr(Type),                                      \
  static_cast<int>(Type))

#define WM_TABTIP_DISPLAYINPUTWND    WM_USER + 39

enum EmTabTipSysItem
{
    TabTipSysBase = 0x00000010,
    TabTipSysServer2016
};

class CIPCWndServer;
class CIPCWndClient;
class CTabTipSystemBase : public IIPCWndCallBack
{
    TABTIP_DECLAREREG_CLASS(CTabTipSystemBase, TabTipSysBase);
public:
    CTabTipSystemBase();

    virtual ~CTabTipSystemBase();

    virtual BOOL InstallNotification();

    virtual BOOL UninstallNotification();

    virtual BOOL InstallWndForIPC();

    virtual BOOL UninstallWndForIPC();

    LRESULT OnProcessIPCMsg(UINT msg, WPARAM wparam, LPARAM lparam) override;

protected:
    void    ObtainDbgWndHWnd();

    virtual BOOL InstallImmersiveFocusTracking();

    virtual BOOL UninstallImmersiveFocusTracking();

    virtual BOOL Initialize();

    virtual BOOL Uninitialize();

public:
    static HWND    m_hStaFocusEdit;

    static HWND    m_hStaFocusAncestor;

    static HWND    m_hStaFocusEditPointHWnd;

    static RECT    m_rtStaFocusEdit;

    static bool    m_bStaStartListenMouseUp;

    static bool    m_bStaShowingInputWnd;

    static CIPCWndClient*  ms_pIPCWndClient;
protected:
    CIPCWndServer* m_pIPCWndServer;

private:
    WCHAR    m_szBufImmersiveFocusEventName[50];

    HANDLE   m_hImmersiveEvent;

    HWND     m_hTabtipNotifyDbgWnd;
};

